package com.xiyu.service.repository.customer.duplicate;

import com.xiyu.service.model.customer.duplicate.CustomerCheckSetting;
import com.xiyu.service.model.customer.duplicate.CustomerCheckSettingTable;
import org.babyfish.jimmer.spring.repository.JRepository;

import java.util.Optional;
import java.util.List;

public interface CustomerCheckSettingRepository extends JRepository<CustomerCheckSetting, Long> {
    CustomerCheckSettingTable customerCheckSettingTable = CustomerCheckSettingTable.$;

    default void deleteByNotInColumnId(List<String> columnNames){
        sql().createDelete(customerCheckSettingTable)
                .where(customerCheckSettingTable.columnName().notIn(columnNames))
                .execute();
    }

    Optional<CustomerCheckSetting> findByColumnName(String columnName);


}